package com.xuxiao.config;

import org.springframework.context.ApplicationContext;
import org.springframework.context.event.SimpleApplicationEventMulticaster;

/**
 * 实现静态封装 此类应该是工具类
 * @author xuxiao
 */
public class SpringPublisherStatic {

    public static void publishEventError(SpringEventEntity springEventEntity){
        ApplicationContext applicationContext = ApplicationContextUtils.getApplicationContext();
        SimpleApplicationEventMulticaster bean = applicationContext.getBean(SimpleApplicationEventMulticaster.class);
        bean.multicastEvent(springEventEntity);
    }

}
